1208 support android auto notifications - #6012
Conversation
c1df884 to
de4c146
Compare
|
Thank you @anakin78z We will review soon. As a side note: In the past there were already two approaches to support Android Auto which then were declined by Google Play review process for unknown reasons (The last time it was introduced with #5481 and then reverted again with #5880 )
|
|
Odd. There are a few things in my PR which may or may not have addressed some issues they found:
|
Thank for the hints and please excuse the delay (i was on vacation). |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
@rapterjet2004 can you take over the review? |
de4c146 to
1498f18
Compare
|
fixed merge conflict |
1498f18 to
1a4662e
Compare
|
Please excuse the current delays in pull request reviews. |
|
We are now trying to catch up with the pull request reviews. The PR is not forgotten and should be picked up soon. |
|
still on our list! |
|
..and still on our list. @rapterjet2004 could you schedule it for review? |
|
still on our list! |
|
Sorry about the delay, this is still on my TODO list |
🚀 Features & Improvements • Unified Messaging Style: Migrated all chat notifications (including images) to use NotificationCompat.MessagingStyle. This ensures that text and image messages from the same conversation are correctly stacked in the notification shade and work seamlessly with Android Auto. • Efficient Avatar Loading: Optimized the notification flow by loading the sender's profile picture once and reusing it for the notification style, the large icon, and the conversation shortcut. • Image Previews in Conversations: Implemented a secure mechanism to share image previews in MessagingStyle by saving them to a temporary cache and sharing them via FileProvider. • Modern Conversation Shortcuts: Enhanced the pushConversationShortcut logic to include the sender's avatar, improving the "People" integration in Android 11+. 🛡️ Security • PendingIntent Hardening: Performed a security audit and updated all PendingIntent flags to FLAG_IMMUTABLE by default. FLAG_MUTABLE is now only used where strictly necessary (e.g., for direct replies from notifications). 🧹 Code Quality • Refactoring: Consolidated duplicate styling logic into a single styleConversationNotification function. • Cleanup: Removed obsolete styling methods and unused imports. • Static Analysis: Verified all changes with ktlint and detekt. Added necessary suppressions for legacy complexity in NotificationWorker.kt to ensure a clean build. AI-assistant: Gemini 2.0 Flash (plan: Gemini 2.0 Flash, edit: Gemini 2.0 Flash) Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
54f52fb to
51550e9
Compare
This addresses issue #1208 and also implements sender profile picture display in notifications.
I left the profile picture code as a separate commit, if for some reason we didn't want to merge that now. The notifications look pretty bad without it on Android Auto though.
🖼️ Screenshots
The first notification is from Nextcloud Talk. The second is from Google Messages for comparison.
Full video demo here: https://youtu.be/VWINe70FJkE
TESTING
Please check the SETUP.md file for instructions on how to test with Android Auto. It took me waaaaay too long to figure out why notifications weren't showing up with my implementation 😅
🚧 TODO
Optional: Image notifications currently do not get stacked with text only messages. They also do not use the same Avatar style in notifications. This is because image notifications use
NotificationCompat.BigPictureStyleinstead ofNotificationCompat.MessagingStyle. We could update it to use MessagingStyle, but the images could display smaller. E.g.Note that these screenshots do not have any of the avatar work applied.
It looks like picture preview in notifications is a recent thing, so I didn't want to mess with it too much, but let me know if you'd prefer to have that changed/implemented as part of this PR.
🏁 Checklist
/backport to stable-xx.x